-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reuse session csrf token #28
Reuse session csrf token #28
Conversation
This allows multiple tabs to be open at the same time, without compromising security. Now, the cookie includes both a hash and the token, separated by "|". This allows the token generator to extract the token from an existing csrf session cookie and reuse it.
So I've just had some additional thoughts:
|
I've pulled down your branch and made some changes on the branch: https://github.com/Psifi-Solutions/csrf-csrf/tree/reuse-session-csrf-token You may be able to cherry-pick the commit: b24f941 My plan is for this to be a major update given the changes, thus I am also setting the default of overwrite to false - this way it mimics the Additionally, in another PR after this one, I'll make another breaking change which will finally switch the order of response and request params for |
Reuse token from existing session cookie.
This enables multitab support by not overwriting existing csrf cookies.
Functionality can be toggled with the param 'overwrite', which defaults to true (reusability of tokens is disabled by default).